#include <cstdio>
using namespace std;
#define N 200001
int n, ans;
int a[N], s[N][2];
int main() {
	freopen("square.in", "r", stdin);
	freopen("square.out", "w", stdout);
	scanf("%d", &n); 
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j <= 1; ++j) {
			s[i][j] = s[i - 1][j] + ((i & 1) == j) * a[i];
		}
	}
	for (int i = 1; i <= n; ++i) {
		if (s[i-1][1] + s[n][0] - s[i][0] == s[i-1][0] + s[n][1] - s[i][1])
			++ans;
	}
	printf("%d", ans);
	fclose(stdin);
	fclose(stdout);
	return 0;
}